package com.neusoft.ysu.populationmanagement.controller;


import com.neusoft.ysu.populationmanagement.entity.CommonResult;
import com.neusoft.ysu.populationmanagement.entity.OperationLog;
import com.neusoft.ysu.populationmanagement.service.IVFloPopService;
import com.neusoft.ysu.populationmanagement.vo.VFloPop;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * VIEW 前端控制器
 * </p>
 *
 * @author zzh
 * @since 2025-06-13
 */
@RestController
@RequestMapping("/v-flo-pop")
@CrossOrigin
public class VFloPopController {
    @Autowired
    IVFloPopService vFloPopService;

    /**
     * @author ecl
     * @description 采集流动人口信息
     * @date 2025-06-13
     * @param vFloPop
     * @param log
     * @return CommonResult
     */
    @RequestMapping("/insert")
    public CommonResult insert(VFloPop vFloPop,OperationLog log){
//        System.out.println("insert:");
//        System.out.println(" "+vFloPop);
//        System.out.println(" "+log);
        return vFloPopService.insertVFLo(vFloPop,log);
    }
    /**
     * @author qym
     * @date 2025-06-13
     * @description 更新流动人口信息
     * @param vFloPop
     * @param log
     * @return CommonResult
     */
    @RequestMapping("/update")
    public CommonResult update(VFloPop vFloPop,OperationLog log){
        return vFloPopService.updateVFLo(vFloPop,log);
    }
    /**
     * @author qym
     * @date 2025-06-13
     * @description 流动人口注销（更改is_delete）
     * @param vFloPop
     * @param log
     * @return CommonResult
     */
    @RequestMapping("/delete")
    public CommonResult delete(VFloPop vFloPop,OperationLog log){
        return vFloPopService.deleteVFLo(vFloPop,log);
    }

    @RequestMapping("/selectByIdNum")
    public CommonResult selectByIdNum(String idnum){
        return vFloPopService.selectFloByIdNum(idnum);
    }
}
